﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using COFE.Core.Lister;

namespace COFE.Core.Entry
{
    /// <summary>
    /// Base interface for providing COFE Property support.
    /// </summary>
    /// <typeparam name="T">The interface the class implementing
    /// (IFileSystemInfo, IEntryList, IEventLog), 
    /// for obtain secondary property.</typeparam>
    public interface IPropertyHost
    {
        IPropertyProvider PrimaryPropertyProvider { get; }

        /// <summary>
        /// Whether support the property specified.
        /// </summary>
        /// <param name="property"></param>
        /// <returns></returns>
        bool IsPropertySupported(object property,
            PropertyRetrivalOptions options = PropertyRetrivalOptions.NotApplied);
      
        /// <summary>
        /// Get all supported properties and actions, if filters != null, the property must also match any or all of the specified filters.
        /// </summary>
        /// <param name="matchMode"></param>
        /// <param name="options"></param>
        /// <param name="filters"></param>
        /// <returns></returns>
        object[] GetSupportedProperty(
            PropertyRetrivalOptions options = PropertyRetrivalOptions.NotApplied,
            MatchMode matchMode = MatchMode.All, 
            params IPropertyFilter[] filters);

        /// <summary>
        /// Get value of a property.
        /// </summary>
        /// <param name="property"></param>
        /// <returns></returns>
        PropertyPair GetProperty(object property, 
            PropertyRetrivalOptions options = PropertyRetrivalOptions.NotApplied);

        
        /// <summary>
        /// Set value of a property.
        /// </summary>
        /// <exception cref="NotSupportedException">The property do not support write.</exception>
        /// <exception cref="KeyNotFoundException">The property is not supported at all.</exception>
        /// <param name="property"></param>
        /// <param name="value"></param>
        void SetProperty(object property, object value,
            PropertyRetrivalOptions options = PropertyRetrivalOptions.NotApplied);   

    }


    public interface IPropertyHost<T> : IPropertyHost
    {

    }
    
}
